# 词句统计

x = input()

x =" "+x
#单词
bd = " "
cy=0
jz=0
for i in x:
    if str.isalpha(i) is True and bd in ' .!?,;"':
        cy=cy+1
    bd=i
for i in x:
    if i in'.!?':
        jz=jz+1

print("单词{}句子{}".format(cy,jz))